layui.define([ 'form','layer' ], function(exports) {
    var $ = layui.$;
    var layer = layui.layer;
    var form = layui.form,el;
    var view = {
        config:{
            form:''
        },
        render: function(options){
            this.config = $.extend(this.config,options);
            this.$form = $(this.config.form);

            this.initVerify();
        },
        initVerify() {//初始化表单中各个控件的验证
            var that = this;

            form.on('submit(' + this.$form.attr("id") + ')', function(data){
                Lib.submitForm("/core/member/login.json", that.$form, {}, function(data){
                    //console.log(data);
                    Common.info("登录成功");
                    document.location.href= Common.tplPath + "/space/index.do"
                    return false;
                    //location.reload();
                })
                return false;
            });

        }
    };
	exports('login', view);
});